package com.tiger.userClient.http.deptContacts;

import com.tiger.userClient.interceptor.RequireAuth;
import com.tiger.utils.ResponseUtil;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("deptContacts")
public class DeptContactsController {
    private final DeptContactsService deptContactsService;

    public DeptContactsController(DeptContactsService deptContactsService) {
        this.deptContactsService = deptContactsService;
    }

    @RequireAuth
    @GetMapping("list")
    public Object list() {
        return ResponseUtil.successRes(deptContactsService.list());
    }

    @RequireAuth
    @GetMapping("contacts/{id}")
    public Object contacts(@PathVariable Integer id) {
        return ResponseUtil.successRes(deptContactsService.contacts(id));
    }
}
